<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="__STATIC__/index/css/newgoods.css">
  <link rel="stylesheet" href="__STATIC__/index/css/quan_common.css">
  <link rel="stylesheet" href="__STATIC__/index/css/single.css">
  <link rel="stylesheet" href="__STATIC__/index/css/common.css">
  <link rel="stylesheet" href="__STATIC__/index/css/uc_common.css">
  <link rel="stylesheet" href="__STATIC__/index/css/bootstrap.css">
  <link rel="stylesheet" href="__STATIC__/index/css/all.css">
  <link rel="stylesheet" href="__STATIC__/index/css/web_base.css">
  <link rel="stylesheet" href="__STATIC__/index/css/center2.css">
  <script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
  <script src="__STATIC__/index/js/area.js"></script>
   <script src="__STATIC__/layui/layui.js"></script>
  <title>我的信息</title>
  <style>
				    .my-input select{
				        width: 240px!important;
				    }
				    .form-horizontal{
				        margin-left: 30px;
				    }
				    label.checkbox-inline i, label.checkbox-inline.disabled:hover i{
				      background-position: -26px 0;
				    }
				    label.checkbox-inline i, label.radio-inline i, label.radio-inline.disabled:hover i{
				      background: url('img/uc-pic.png') no-repeat;
				    }
				    .pub-header .head-block .yrz .user-block .username i {
				    top: 31px;
				}
 
          .cf {
              clear: both;
            }
    
            .tab-left {
              float: none !important;
              border-bottom: 1px solid #E6EAEB;
              width: 100% !important;
              margin-top: 20px;
              padding: 0 0 0 55px !important;
            }
    
            .tab-left li a {
              color: #666;
              text-decoration: none;
            }
    
            .tab-left li {
              float: left;
              margin-left: 5px;
              padding: 10px 20px;
              border: #F9F9F9 1px solid;
              background-color: #F9F9F9;
            }
    
            .tab-left li.cur a {
              text-decoration: none;
              color: #337ab7
            }
    
            .tab-left li.cur {
              background-color: #fff !important;
              border: 1px solid #E6EAEB;
              border-bottom: none;
              padding-bottom: 11px;
              position: relative;
              top: 1px;
            }
            
              .my-input select {
              width: 240px !important;
            }
            .form-horizontal {
              margin-left: 30px;
            }
						.seller_centre a{
							color: #3286ff;
							background: #eff6ff;
						}

          </style>


</head>
<script type="text/javascript">
	layui.use('laydate', function(){
  var laydate = layui.laydate;
  //常规用法
  laydate.render({
    elem: '#test1'
  });
  
 });
  
 function button_new(){
 	var sex = $('.cur').children('input').val();
 	var age = $('#test1').val();
 	var s_province = $('#s_province').val();
 	var s_city = $('#s_city').val();
  var qq =$('#qq').val();
  var weixin = $('#weixin').val();
  var address=s_province+s_city;
  var data = {
  	   sex:sex,
       age:age,
       address:address,
       qq:qq,
       weixin:weixin,
  };
  if(age == ''){
		layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert('请填写您的生日', {icon: 2});
					});              
			 		return false
  }
   if(s_province == '省份' || s_city =='地级市' ){
		layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert('请填写地址', {icon: 2});
					});              
			 		return false
  }
 	  if(!(qq!='' || weixin !='')){
		layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert('至少输入一个联系方式', {icon: 2});
					});              
			 		return false
  }
 	  $.ajax({
 	  	type:"post",
 	  	url:"{:url('personal/personal_ins')}",
 	  	data:data,
 	  	success:function(res){
 	  		if(res.code==1){
 	  			layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert(res.msg, {icon: 1},function(){
				  	location.reload(); 
				  });
					}); 
 	  		}else{
 	  			layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert(res.msg, {icon: 2},function(){
				  	location.reload(); 
				  });
					});
 	  		}
 	  		
 	  	}
 	  });
 	  
 }
</script>

<body>
	{include file='common/heade'}
	<div style="width: 100%;">
      <div style="width:1000px;margin: auto;background:#fff;padding: 30px 0;">
       

        <div class="tab-left">
          <ul>
            <li class="cur">
              <a href="{:url('index/personal/centre')}">我的信息 </a>
            </li>
            <li class="">
              <a href="{:url('index/personal/security')}">帐号安全 </a>
            </li>
          </ul>
          <div class="cf"></div>

        </div>
     
        <div class="tab-right" style="margin-top:30px;">
          <div>
            <form class="form-horizontal" action="/">
              <!--        <div class="uc-info-title">个人信息</div>-->
              <div class="form-group form-group-text">
                <label class="col-xs-2 uc-control-label">性别：</label>
                <div class="col-xs-10 my-input my-radio">
                	{if $arr.sex ==1}
		                  <label class="radio-inline cur"><i></i><input class="ucenter_form_data" type="radio" name="gender"
		                      value="1">男</label>
		                  <label class="radio-inline  "><i></i><input class="ucenter_form_data" type="radio" name="gender"
		                      value="2" >女</label>
                      {else}
                       <label class="radio-inline "><i></i><input class="ucenter_form_data" type="radio" name="gender"
                      value="1">男</label>
                      <label class="radio-inline cur"><i></i><input class="ucenter_form_data" type="radio" name="gender"
                      value="2" >女</label>
                      {/if}
                </div>
              </div>
              <div class="form-group">
                <label class="col-xs-2 uc-control-label">生日：</label>
                <div class="col-xs-10 my-input">
                	  <input type="text" class="layui-input form-control ucenter_form_data uc-input-long" id="test1" placeholder="请选择生日"  name="birthday" value="{$arr.age|date="Y-m-d",###}" >
                  <!--<input type="text" id="date-start" class="form-control ucenter_form_data uc-input-long layui-input" value="" name="birthday"
                    placeholder="请选择生日" lay-key="1" id="test1">-->
                </div>
              </div>
              <div class="form-group select-addres">
                <label class="col-xs-2 uc-control-label">所在地：</label>
                <div class="col-xs-10 my-input">
                  <select id="s_province" class="form-control ucenter_form_data" name="s_province">
                    <option value="0">请选择</option> 
                  </select>
                  <select id="s_city" class="form-control ucenter_form_data" name="s_city">
                    <option value="0">请选择</option>
                  </select>
                </div>
                <script>
                  var s = ['s_province', 's_city'];
                    _init_area();
                  </script>
              </div>
              <div class="form-group">
                <label class="col-xs-2 uc-control-label"> 联系QQ：</label>
                <div class="col-xs-10 my-input">
                  <input type="text" class="form-control ucenter_form_data uc-input-long" maxlength="11" autocomplete="off"
                    name="" value="{$arr.qq}" placeholder="" id="qq">
                </div>
              </div>
              <div class="form-group">
                <label class="col-xs-2 uc-control-label"> 联系微信：</label>
                <div class="col-xs-10 my-input">
                  <input type="text" class="form-control ucenter_form_data uc-input-long" maxlength="11" autocomplete="off"
                    name="" value="{$arr.weixin}" placeholder="" id="weixin">
                </div>
              </div>

              <div class="uc-info-title"></div>
              <div class="form-group">
                <label class="col-xs-2 uc-control-label"></label>
                <div class="col-xs-5 form-group-sub">
                  <span class="fl btn btn-primary ucenter_form_info_submit" style="font-size:14px;padding: 0 15px;" onclick="button_new()" >确认并保存</span>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
   
</div> 
</body>
<script>
  $(".radio-inline").on("click", function () {
    $(this).addClass("cur");
    $(this).siblings("label").removeClass("cur");
  })
  $(".checkbox-inline").on("click", function () {
    if ($(event.target).is("input")) {
      return;
    }
    var that = $(this);
    // var yorn=$(this).hasClass("cur");
    if (!$(this).hasClass("cur")) {
      that.addClass("cur")
    } else {
      that.removeClass("cur")
    }
  })
</script>

</html>